﻿using ConfExpert.Forms.Base;
using DevExpress.Data;
using DevTeam;

using System;
namespace ConfExpert.Forms.Depo._7C
{
    public partial class KalanExecutionlar : XForm
    {
        int CKBatchId = 0;
        public KalanExecutionlar(int ckBatchId)
        {
            InitializeComponent();
            this.CKBatchId = ckBatchId;
            this.Text = "Kalanlar";
        }

        private void KalanExecutionlar_Load(object sender, EventArgs e)
        {

            gridView1.Init("GetExecutionsKalan", CKBatchId);
            gridView1.AddDetailGrid(gridView2, "ProductId");

            gridView1.ChangeExpression("QtyFARK", "ISNULL(QtyAyrilan,0)-ISNULL(Qty,0)");
            gridView1.FormatAsNumber(1, "QtyAx", "QtyGx", "Qty", "QtyAyrilan", "QtyFARK", "QtyIDLE");
            gridView1.AddSummary("QtyAx", "QtyGx", "Qty", "QtyIDLE", "QtyAyrilan", "QtyFARK");

            gridView2.FormatAsNumber(1, "QtyAx", "QtyGx");
            gridView2.FormatAsNumber(0, "Adet");
            gridView2.AddSummary("QtyAx", "QtyGx");

            splitContainerControl1.AutoSize();

            gridView1.BeginSort();
            gridView1.Columns["QtyFARK"].SortOrder = ColumnSortOrder.Ascending;
            gridView1.EndSort();

            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
        }
    }
}
